<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<script src="${webRoot}/plug-in/cgform/js/cgformField.js"></script>
<script type="text/javascript">
	$('#addCommodityvarietyattrBtn').linkbutton({   
	    iconCls: 'icon-add'  
	});  
	$('#delCommodityvarietyattrBtn').linkbutton({   
	    iconCls: 'icon-remove'  
	}); 
	$('#addCommodityvarietyattrBtn').bind('click', function(){
 		 var tr =  $("#add_commodityvarietyattr_table_template tr").clone();
	 	 $("#add_commodityvarietyattr_table").append(tr);
	 	 resetTrNum1('#add_commodityvarietyattr_table');
	 	 return false;
    });
	$('#delCommodityvarietyattrBtn').bind('click', function(){   
		$("#add_commodityvarietyattr_table").find("input[name$='ck']:checked").parent().parent().remove();  
        resetTrNum('add_commodityvarietyattr_table');
        return false;
    }); 
    $(document).ready(function(){
    	$(".datagrid-toolbar").parent().css("width","auto");
    	if(location.href.indexOf("load=detail")!=-1){
			$(":input").attr("disabled","true");
			$(".datagrid-toolbar").hide();
		}
    });
</script>
<div style="padding: 3px; height: 25px;width:auto;" class="datagrid-toolbar">
	<a id="addCommodityvarietyattrBtn" href="#">添加</a> <a id="delCommodityvarietyattrBtn" href="#">删除</a>
</div>
<table border="0" cellpadding="2" cellspacing="0" id="commodityvarietyattr_table">
	<tr bgcolor="#E6E6E6">
		<td align="center" bgcolor="#EEEEEE" style="width: 25px;">序号</td>
		<td align="center" bgcolor="#EEEEEE" style="width: 25px;">操作</td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						属性标识名称
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						属性显示中文名称
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						属性类型
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						属性数值类型
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						控件类型
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						默认值
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						引用对象
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						是否有效
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						排序
				  </td>
				  <!--  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						占位列数
				  </td>-->
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						符号
				  </td>
				  <td align="left" bgcolor="#EEEEEE" style="width: 126px;">
						单位
				  </td>
	</tr>
	<tbody id="add_commodityvarietyattr_table">
	<c:if test="${fn:length(commodityvarietyattrList)  <= 0 }">
			<tr>
				<td align="center"><div style="width: 25px;" name="xh">1</div></td>
				<td align="center"><input style="width:20px;"  type="checkbox" name="ck"/></td>
					<input name="commodityvarietyattrList[0].id" type="hidden"/>
					<input name="commodityvarietyattrList[0].attrid" type="hidden"/>
					<input name="commodityvarietyattrList[0].sysid" type="hidden"/>
					<input name="commodityvarietyattrList[0].varietyid" type="hidden"/>
					<input name="commodityvarietyattrList[0].attrtype" type="hidden"/>
					<input name="commodityvarietyattrList[0].length" type="hidden"/>
					<input name="commodityvarietyattrList[0].precision" type="hidden"/>
					<input name="commodityvarietyattrList[0].attrprimary" type="hidden"/>
					<input name="commodityvarietyattrList[0].expression" type="hidden"/>
					<input name="commodityvarietyattrList[0].groupname" type="hidden"/>
					<input name="commodityvarietyattrList[0].validator" type="hidden"/>
					<input name="commodityvarietyattrList[0].layout" type="hidden"/>
					<input name="commodityvarietyattrList[0].iskey" type="hidden"/>
					<input name="commodityvarietyattrList[0].exparam1" type="hidden"/>
					<input name="commodityvarietyattrList[0].exparam2" type="hidden"/>
					<input name="commodityvarietyattrList[0].attrtitleEn" type="hidden"/>
					<input name="commodityvarietyattrList[0].unitEn" type="hidden"/>
				  <td align="left">
					  	<input name="commodityvarietyattrList[0].attrname" maxlength="30" type="text" class="inputxt"  style="width:120px;"  datatype="*"  ignore="checked" >
					  <label class="Validform_label" style="display: none;">属性标识名称</label>
					</td>
				  <td align="left">
					  	<input name="commodityvarietyattrList[0].attrtitle" maxlength="50" type="text" class="inputxt"  style="width:120px;"  datatype="*"  ignore="checked" >
					  <label class="Validform_label" style="display: none;">属性显示中文名称</label>
					</td>
					  <td align="left">
							<t:dictSelect field="commodityvarietyattrList[0].attrtype" type="list"  datatype="*"   typeGroupCode="COMMODITYVARIETYATTRTYPE"  defaultVal="${commodityvarietyattrPage.attrtype}" hasLabel="false"  title="属性类型"></t:dictSelect>     
					  <label class="Validform_label" style="display: none;">属性类型</label>
					</td>
				  <td align="left">
							<t:dictSelect field="commodityvarietyattrList[0].attrobjecttype" type="list"  datatype="*"   typeGroupCode="ATTOBJTYPE"  defaultVal="${commodityvarietyattrPage.attrobjecttype}" hasLabel="false"  title="属性数值类型"></t:dictSelect>     
					  <label class="Validform_label" style="display: none;">属性数值类型</label>
					</td>
				  <td align="left">
							<t:dictSelect field="commodityvarietyattrList[0].controltype" type="list"  datatype="*"   typeGroupCode="CONTYPE"  defaultVal="${commodityvarietyattrPage.controltype}" hasLabel="false"  title="控件类型"></t:dictSelect>     
					  <label class="Validform_label" style="display: none;">控件类型</label>
					</td>
				  <td align="left">
					  	<input name="commodityvarietyattrList[0].defaultvalue" maxlength="100" type="text" class="inputxt"  style="width:120px;"  ignore="ignore" >
					  <label class="Validform_label" style="display: none;">默认值</label>
					</td>
				  <td align="left">
					  	<input name="commodityvarietyattrList[0].refobject" maxlength="30" type="text" class="inputxt"  style="width:120px;"  ignore="ignore" >
					  <label class="Validform_label" style="display: none;">引用对象</label>
					</td>
				  <td align="left">
							<t:dictSelect field="commodityvarietyattrList[0].isvalid" type="list"  datatype="*"   typeGroupCode="ISN"  defaultVal="${commodityvarietyattrPage.isvalid}" hasLabel="false"  title="是否有效"></t:dictSelect>     
					  <label class="Validform_label" style="display: none;">是否有效</label>
					</td>
				  <td align="left">
					  	<input name="commodityvarietyattrList[0].orderid" maxlength="19" type="text" class="inputxt"  style="width:120px;"  datatype="n"  ignore="ignore" >
					  <label class="Validform_label" style="display: none;">排序</label>
					</td>
				<!--	 <td align="left">
					  	<input name="commodityvarietyattrList[0].layout" maxlength="20" type="text" class="inputxt"  style="width:120px;"  ignore="checked" >
					  <label class="Validform_label" style="display: none;">占位列数</label>
					</td>  -->
				  <td align="left">
					  	<input name="commodityvarietyattrList[0].sign" maxlength="20" type="text" class="inputxt"  style="width:120px;"  ignore="ignore" >
					  <label class="Validform_label" style="display: none;">符号</label>
					</td>
				  <td align="left">
					  	<input name="commodityvarietyattrList[0].unit" maxlength="20" type="text" class="inputxt"  style="width:120px;"  ignore="ignore" >
					  <label class="Validform_label" style="display: none;">单位</label>
					</td>
   			</tr>
	</c:if>
	<c:if test="${fn:length(commodityvarietyattrList)  > 0 }">
		<c:forEach items="${commodityvarietyattrList}" var="poVal" varStatus="stuts">
			<tr>
				<td align="center"><div style="width: 25px;" name="xh">${stuts.index+1 }</div></td>
				<td align="center"><input style="width:20px;"  type="checkbox" name="ck" /></td>
						<input name="commodityvarietyattrList[${stuts.index }].id" type="hidden" value="${poVal.id }"/>
						<input name="commodityvarietyattrList[${stuts.index }].attrid" type="hidden" value="${poVal.attrid }"/>
						<input name="commodityvarietyattrList[${stuts.index }].sysid" type="hidden" value="${poVal.sysid }"/>
						<input name="commodityvarietyattrList[${stuts.index }].varietyid" type="hidden" value="${poVal.varietyid }"/>
						<!-- <input name="commodityvarietyattrList[${stuts.index }].attrtype" type="text" value="${poVal.attrtype }"/> -->
						<input name="commodityvarietyattrList[${stuts.index }].length" type="hidden" value="${poVal.length }"/>
						<input name="commodityvarietyattrList[${stuts.index }].precision" type="hidden" value="${poVal.precision }"/>
						<input name="commodityvarietyattrList[${stuts.index }].attrprimary" type="hidden" value="${poVal.attrprimary }"/>
						<input name="commodityvarietyattrList[${stuts.index }].expression" type="hidden" value="${poVal.expression }"/>
						<input name="commodityvarietyattrList[${stuts.index }].groupname" type="hidden" value="${poVal.groupname }"/>
						<input name="commodityvarietyattrList[${stuts.index }].validator" type="hidden" value="${poVal.validator }"/>
						<input name="commodityvarietyattrList[${stuts.index }].layout" type="hidden" value="${poVal.layout }"/>
						<input name="commodityvarietyattrList[${stuts.index }].iskey" type="hidden" value="${poVal.iskey }"/>
						<input name="commodityvarietyattrList[${stuts.index }].exparam1" type="hidden" value="${poVal.exparam1 }"/>
						<input name="commodityvarietyattrList[${stuts.index }].exparam2" type="hidden" value="${poVal.exparam2 }"/>
						<input name="commodityvarietyattrList[${stuts.index }].attrtitleEn" type="hidden" value="${poVal.attrtitleEn }"/>
						<input name="commodityvarietyattrList[${stuts.index }].unitEn" type="hidden" value="${poVal.unitEn }"/>
				   <td align="left">
					  	<input name="commodityvarietyattrList[${stuts.index }].attrname" maxlength="30" type="text" class="inputxt"  style="width:120px;"  datatype="*"  ignore="checked"  value="${poVal.attrname }"/>
					  <label class="Validform_label" style="display: none;">属性标识名称</label>
				   </td>
				   <td align="left">
					  	<input name="commodityvarietyattrList[${stuts.index }].attrtitle" maxlength="50" type="text" class="inputxt"  style="width:120px;"  datatype="*"  ignore="checked"  value="${poVal.attrtitle }"/>
					  <label class="Validform_label" style="display: none;">属性显示中文名称</label>
				   </td>
				     <td align="left">
							<t:dictSelect field="commodityvarietyattrList[${stuts.index }].attrtype" type="list"  datatype="*"   typeGroupCode="COMMODITYVARIETYATTRTYPE"  defaultVal="${poVal.attrtype}" hasLabel="false"  title="属性类型"></t:dictSelect>     
					  <label class="Validform_label" style="display: none;">属性类型</label>
					</td>
				   <td align="left">
							<t:dictSelect field="commodityvarietyattrList[${stuts.index }].attrobjecttype" type="list"  datatype="*"   typeGroupCode="ATTOBJTYPE"  defaultVal="${poVal.attrobjecttype }" hasLabel="false"  title="属性数值类型"></t:dictSelect>     
					  <label class="Validform_label" style="display: none;">属性数值类型</label>
				   </td>
				   <td align="left">
							<t:dictSelect field="commodityvarietyattrList[${stuts.index }].controltype" type="list"  datatype="*"   typeGroupCode="CONTYPE"  defaultVal="${poVal.controltype }" hasLabel="false"  title="控件类型"></t:dictSelect>     
					  <label class="Validform_label" style="display: none;">控件类型</label>
				   </td>
				   <td align="left">
					  	<input name="commodityvarietyattrList[${stuts.index }].defaultvalue" maxlength="100" type="text" class="inputxt"  style="width:120px;"  ignore="ignore"  value="${poVal.defaultvalue }"/>
					  <label class="Validform_label" style="display: none;">默认值</label>
				   </td>
				   <td align="left">
					  	<input name="commodityvarietyattrList[${stuts.index }].refobject" maxlength="30" type="text" class="inputxt"  style="width:120px;"  ignore="ignore"  value="${poVal.refobject }"/>
					  <label class="Validform_label" style="display: none;">引用对象</label>
				   </td>
				   <td align="left">
							<t:dictSelect field="commodityvarietyattrList[${stuts.index }].isvalid" type="list"  datatype="*"   typeGroupCode="ISN"  defaultVal="${poVal.isvalid }" hasLabel="false"  title="是否有效"></t:dictSelect>     
					  <label class="Validform_label" style="display: none;">是否有效</label>
				   </td>
				   <td align="left">
					  	<input name="commodityvarietyattrList[${stuts.index }].orderid" maxlength="19" type="text" class="inputxt"  style="width:120px;"  datatype="n"  ignore="ignore"  value="${poVal.orderid }"/>
					  <label class="Validform_label" style="display: none;">排序</label>
				   </td>
				 <!--    <td align="left">
					  	<input name="commodityvarietyattrList[${stuts.index }].layout" maxlength="20" type="text" class="inputxt"  style="width:120px;"  ignore="checked"  value="${poVal.layout }"/>
					  <label class="Validform_label" style="display: none;">占位列数</label>
				   </td> -->
				   <td align="left">
					  	<input name="commodityvarietyattrList[${stuts.index }].sign" maxlength="20" type="text" class="inputxt"  style="width:120px;"  ignore="ignore"  value="${poVal.sign }"/>
					  <label class="Validform_label" style="display: none;">符号</label>
				   </td>
				   <td align="left">
					  	<input name="commodityvarietyattrList[${stuts.index }].unit" maxlength="20" type="text" class="inputxt"  style="width:120px;"  ignore="ignore"  value="${poVal.unit }"/>
					  <label class="Validform_label" style="display: none;">单位</label>
				   </td>
   			</tr>
		</c:forEach>
	</c:if>	
	</tbody>
</table>
